home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
system
/
ifp1s158.zip
/
PAGE_09.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-09-17
|
18KB
|
699 lines
unit page_09;
interface
uses crt, dos, ifpglobl, ifpcomon;
procedure page09;
implementation
procedure page09;
const
weekday: array[0..6] of string[9] = ('Sunday', 'Monday', 'Tuesday',
'Wednesday', 'Thursday', 'Friday', 'Saturday');
var
foundit, xbool, wasone: boolean;
xbyte: byte;
xchar: char;
xstring1: string;
xstring2: string;
xword1: word;
xword2: word;
xword3: word;
xword4: word;
xword5: word;
xword6: word;
xword7: word;
xword8: word;
filecount, usedfiles, tablesize: word;
dt: DateTime;
s: string;
procedure showecho(a: word);
var
xbyte : byte;
begin
xbyte:=Mem[DOScseg : a];
case xbyte of
$00 : Writeln('off');
$FF : Writeln('on')
else
unknown('status', xbyte, 2)
end
end; {showecho}
procedure showbufs(a : word);
const
bufsmax = 99;
var
i : 0..bufsmax + 1;
xbool : boolean;
xword1 : word;
xword2 : word;
xword3 : word;
begin
if (OSMajor < 4) or (OSMajor >= 10) then
begin
i:=0;
xword1:=MemW[DOScseg : a];
xword2:=MemW[DOScseg : a + 2];
xbool:=false;
repeat
if i <= bufsmax then
begin
if xword1 < $FFFF then
begin
inc(i);
xword3:=xword1;
xword1:=MemW[xword2 : xword3];
xword2:=MemW[xword2 : xword3 + 2]
end
else
begin
xbool:=true;
Writeln(i)
end
end
else
begin
xbool:=true;
dontknow
end
until xbool
end
else
with regs do
begin
AX:=$5200;
MsDos(regs);
Write(MemW[ES:BX + $3F]:5);
Caption3('Read-ahead');
Writeln(MemW[ES:BX + $41]);
if OSMajor = 4 then
begin
Caption3('in EMS');
xword2:=MemW[ES:BX + $12];
xword1:=MemW[ES:BX + $14];
case Mem[xword1: xword2 + $C] of
$00: Writeln('no');
$FF: begin
Write('yes');
Caption3('handle');
Writeln(MemW[xword1: xword2 + $D])
end;
$01: if Mem[xword1: xword2 + $18] = 0 then
Writeln('no')
else
begin
Write('yes');
Caption3('handle');
Writeln(MemW[xword1: xword2 + $18])
end;
else
dontknow
end; {case}
end
end
end; {showbufs}
(* BIX ms.dos/secrets #2 *)
procedure ShowAttrib(s: string; value, mask: byte);
begin
if value and mask = mask then
begin
if wasone then
Write('/');
Write(s);
wasone:=true
end;
end; {ShowAttrib}
begin (* procedure page_09 *)
Window(1, 3, twidth div 2, tlength - 2);
Caption2('DOS version');
with regs do
begin
AX:=$4452;
Flags:=Flags and FCarry;
MsDos(regs);
if NoCarry(regs) then
begin
Write('DR-DOS ');
case AX of
$1063: Writeln('3', decimal, '41');
$1065: Writeln('5', decimal, '00');
$1067: Writeln('6', decimal, '00')
else
Writeln('? code ', Hex(AX, 4));
end;
end
else
begin
if OSMajor >= 10 then
begin
Write('OS/2 ', OSMajor div 10, decimal, AddZero(OSMinor));
Writeln(' DOS session');
end
else
Write(OSMajor, decimal, addzero(OSMinor));
if (OSMajor < 5) or (OSMajor = 10) then
Writeln
else
begin
Caption3('revision');
AX:=$3306;
MsDos(regs);
Writeln(Chr((DL and 7) + Ord('A')));
Caption3('in HMA');
YesOrNo2(DH and $10 = $10);
Caption3('in ROM');
YesOrNo(DH and 8 = 8);
end;
end
end;
with regs do
begin
AX:=$3000;
MsDos(regs);
if (AL <> OSMajor) or (AH <> OSMinor) then
begin
Caption3('SETVER''d to');
Write(AL, decimal);
ZeroPad(AH);
Writeln
end
end;
Caption2('OEM serial number');
with regs do
begin
AX:=$3000;
BX:=0;
MsDos(regs);
Writeln(Hex(BH, 2))
end;
Caption2('System date');
getdate(xword1, xword2, xword3, xword4);
if xword4 < 7 then
Write(weekday[xword4])
else
Write('(', Hex(xword4, 4), ')');
Write(', ');
xword5:=CBW(Country[0], Country[1]);
xchar:=Chr(Country[11]);
case xword5 of
$0001: Writeln(xword3, xchar, xword2, xchar, xword1);
$0002: Writeln(xword1, xchar, xword2, xchar, xword3)
else
Writeln(xword2, xchar, xword3, xchar, xword1)
end;
Caption2('System time');
gettime(xword1, xword2, xword3, xword4);
if Country[17] and 1 = 0 then
case xword1 of
0: Write('12');
1..12: ZeroPad(xword1);
13..23: Write(xword1 - 12)
end
else
ZeroPad(xword1);
Write(Chr(Country[13]));
ZeroPad(xword2);
Write(Chr(Country[13]));
ZeroPad(xword3);
Write(decimal);
ZeroPad(xword4);
if Country[17] and 1 = 0 then
if xword1 > 11 then
Write(' pm')
else
Write(' am');
Writeln;
Caption2('Command load paragraph');
Writeln(Hex(PrefixSeg, 4));
getcbreak(xbool);
offoron('Ctrl-C check', xbool);
Writeln;
getverify(xbool);
offoron('Disk verify', xbool);
Writeln;
Caption2('Switch prefix character');
Writeln(switchar);
Caption2('\DEV\ prefix for devices');
with regs do begin
AX:=$3702;
MSDOS(regs);
if DL = $00 then
Writeln('required')
else
Writeln('optional')
end;
Caption2('Reset boot');
xword1:=MemW[BIOSdseg : $72];
case xword1 of
$0000: Writeln('cold');
$1234, $1200, $EDCB: Writeln('bypass memory test');
$4321: Writeln('preserve memory');
$5678: Writeln('system suspended');
$9ABC{-25924}: Writeln('manufacturing test mode'); (*!$9ABC*)
$ABCD{-21555}: Writeln('system POST loop mode') (*!$ABCD*)
else
unknown('flag', xword1, 4)
end;
Caption2('Boot disk was');
if OSMajor >= 4 then
with regs do
begin
AX:=$3305;
MsDos(regs);
Writeln(Chr(DL+$40), ':')
end
else
dontknow;
(* Byte 12:12 p.178 *)
with regs do begin
Caption2('DOS critical flag');
AX:=$5D06;
MSDOS(regs);
segofs(DS, SI);
Writeln
end;
Caption2('DOS busy flag ');
segofs(DOScseg, DOScofs);
Writeln;
Caption2('Printer echo');
case OSMajor of
3 : case OSMinor div 10 of
0 : dontknow;
1..3 : showecho($02AC)
else
dontknow
end;
4,5,6 : showecho($02FE);
else
dontknow
end;
(* BIX ms.dos/secrets #501 *)
Caption2('PrtSc status');
xbyte:=Mem[BIOSdseg : $0100];
case xbyte of
$00 : Writeln('ready');
$01 : Writeln('busy');
$FF : Writeln('error on last PrtSc')
else
unknown('status', xbyte, 2)
end;
Caption2('Memory allocation');
with regs do begin
AX:=$5800;
MSDOS(regs);
case AL of
0: Writeln('first fit');
1: Writeln('best fit');
2..$3F,$43..$7F,$83..$FF: Writeln('last fit');
$40: Writeln('hi mem first fit');
$41: Writeln('hi mem best fit');
$42: Writeln('hi mem last fit');
$80: Writeln('frst fit,hi then low');
$81: Writeln('best fit,hi then low');
$82: Writeln('last fit,hi then low');
else
dontknow
end
end;
Caption2('DOS buffers');
case OSMajor of
3 : case OSMinor div 10 of
0 : showbufs($013F);
1..3 : showbufs($0038)
else
dontknow
end;
4,5,6 : showbufs(0)
else
dontknow
end;
Caption2('File handle table ');
xword1:=MemW[PrefixSeg : $0036];
xword2:=MemW[PrefixSeg : $0034];
SegOfs(xword1, xword2);
W